package com.onion.utils.http;

import java.util.HashMap;
import java.util.Map;

public class HttpResult<T extends java.io.Serializable> implements java.io.Serializable{

    private int code;
    private Map<String,String> headerMap = new HashMap<>();
    private T body;

    public int getCode() {
        return code;
    }
    public void setCode(int code) {
        this.code = code;
    }

    public Map<String, String> getHeaderMap() {
        return headerMap;
    }
    public void setHeaderMap(Map<String, String> headerMap) {
        this.headerMap = headerMap;
    }
    public void addHeader(String headerKey, String headerValue){
        this.headerMap.put(headerKey, headerValue);
    }

    public T getBody() {
        return body;
    }
    public void setBody(T body) {
        this.body = body;
    }

}